package com.dabaozhan.modules.wx_app.service.impl;

import com.dabaozhan.common.utils.Utils;
import com.dabaozhan.modules.wx_app.dao.PayPassMapper;
import com.dabaozhan.modules.wx_app.entity.PayPassEntity;
import com.dabaozhan.modules.wx_app.service.PayPassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author houzhong
 * @date 2019-01-09 10:22
 */
@Service("payPassService")
public class PayPassServiceImpl implements PayPassService {

    @Autowired
    private PayPassMapper payPassMapper;

    @Override
    public int savePayPass(PayPassEntity v) {
        if (v.getId() == null) {
            v.setId(Utils.id().toString());
        }
        return payPassMapper.save(v);
    }

    @Override
    public int updatePayPass(PayPassEntity v) {
        return payPassMapper.update(v);
    }

    @Override
    public PayPassEntity findByPayUserId(String userId) {

        return payPassMapper.findByPayUserId(userId);
    }
}
